import React, { useRef } from 'react';

export default function UseRef () {
    const inputRef = useRef();
    return (
        <div>
            <input type="text" ref={inputRef} />
            <br/>
            <button onClick={() => {
                console.log(inputRef, inputRef.current, inputRef.current.value);
            }}>click</button>
        </div>
    );
}
